{#用于jqvalidator验证#}
{% macro jqvalidator() %}
    errorElement: 'div',
    errorClass: 'help-block',
    focusInvalid: false,
    errorPlacement: function(error, element){
         error.attr('class','help-block col-xs-7 col-sm-5');
        if(element.is(":radio")){
            error.appendTo( element.parent().parent().parent());
            $(element.parent().parent().parent().parent()).attr('class','form-group has-error');
        } else if (element.is(":checkbox")) {
            error.appendTo ( element.next() );
        } else {
            error.appendTo(element.parent());
            $(element.parent().parent()).attr('class','form-group has-error');
        }

    },
    showErrors: function(errorMap, errorList) {
    this.defaultShowErrors();
    for (var i=0; i<errorList.length;i++) {
    //$(errorList[i].element).parent().next().remove("div"); //删除表单div错误；
    $(errorList[i].element).removeClass('help-block');

    if($('#phone_info_form_pho_start').parent().parent().children('div').length >= 3)
    {

      $(errorList[0].element).parent().next().remove("div")
    }
    $(errorList[i].element).parent().parent().attr('class', 'form-group has-error');

    }
    },
    success: function(lable) {
        $(lable.parent().parent()).attr('class', 'form-group');
    },
{% endmacro %}